import 'package:flutter/material.dart';
import 'package:get/get.dart';

class DeviceDataView extends StatelessWidget {
  final String? imagePath;
  final String label;
  final String? value;

  const DeviceDataView(
      {super.key,
      required this.imagePath,
      required this.label,
      required this.value});

  @override
  Widget build(BuildContext context) {
    return Expanded(
        child: Column(
      mainAxisSize: MainAxisSize.min,
      children: [
        Visibility(
            visible: imagePath != null,
            child: Image.asset(
              imagePath ?? '',
              width: 50,
              height: 50,
            )),
        Text(
          "$label",
          textAlign: TextAlign.center,
          style: TextStyle(color: Color(0xff333333), fontSize: 13),
        ).marginOnly(top: 3, bottom: 4),
        Text(
          value ?? "--",
          style: TextStyle(color: Get.theme.primaryColor, fontSize: 24),
        )
      ],
    ));
  }
}
